resolve bond master from slave MAC when hbond=True - #3134
Conversation
|
Depends on : |
|
@vaishnavibhat can you please add the runs logs from both sles and rhel versions? |
|
@vaishnavibhat how it is different from #3043 |
|
RHEL runs : avocado run network_test.py -m network_test.py.data/network_test_virt_net.yaml --max-parallel-tasks=1 avocado run ethtool_test.py -m ethtool_test.py.data/ethtool_sriov_test.yaml --max-parallel-tasks=1 Test summary: avocado run tcpdump.py -m tcpdump.py.data/tcpdump-virt.yaml --max-parallel-tasks=1 Test summary: |
When interface is specified as a MAC address and hbond=True, get_interface_by_hwaddr() may return the bond master instead of the slave because active-backup bonding makes the master inherit the primary slave's MAC address. Use NetworkInterface.is_bond() to detect this: if the returned interface is already the bond master, use it directly; otherwise it is a slave, and get_bond_master() is called to walk up to the bond master via /sys/class/net/<slave>/master. Also move self.hbond assignment before the interface resolution block so it is available as the branch condition. Signed-off-by: Vaishnavi Bhat <vaishnavi@linux.ibm.com>
96067e3 to
59ae7e2
Compare
|
SLES : JOB ID : d67852bfdaff1a48629234d7a8bbf699032f5b63 JOB ID : eb87304cd13e4de643d5c44129c2a35e2c119d41 Test summary: |
get_interface_by_hwaddr() may return the bond master instead of
the slave because active-backup bonding makes the master inherit
the primary slave's MAC address.
Use NetworkInterface.is_bond() to detect this: if the returned
interface is already the bond master, use it directly; otherwise
it is a slave, and get_bond_master() is called to walk up to the
bond master via /sys/class/net//master.